package com.jzo2o.customer.controller.agency;


import com.jzo2o.customer.model.dto.request.AgencyCertificationAuditAddReqDTO;
import com.jzo2o.customer.model.dto.response.RejectReasonResDTO;
import com.jzo2o.customer.service.IAgencyCertificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * <p>
 * 机构认证信息表 前端控制器
 * </p>
 *
 * @author xd
 * @since 2024-12-12
 */
@RestController
@Api(tags = "机构端 - 机构认证申请相关接口")
@RequestMapping("/agency/agency-certification-audit")
public class AgencyCertificationController {
    @Resource
    IAgencyCertificationService agencyCertificationService;

    /**
     * @author xd
     * 机构认证申请
     * @param dto 申请材料封装类
     */
    @PostMapping
    @ApiOperation("机构认证申请")
    public void agencyCertification(@RequestBody @Valid AgencyCertificationAuditAddReqDTO dto) {
        agencyCertificationService.agencyCertification(dto);
    }

    /**
     * @author xd
     * 查看机构申请认证驳回原因
     * @return  RejectReasonResDTO 封装驳回原因
     */
    @GetMapping("/rejectReason")
    @ApiOperation("查看机构申请认证驳回原因")
    public RejectReasonResDTO getRejectReason(){
        return agencyCertificationService.getRejectReason();
    }
}
